//
//  R_Third_NewYearThings_TVCell.swift
//  MyFood
//
//  Created by dllo on 16/2/16.
//  Copyright © 2016年 XRG. All rights reserved.
//

import UIKit
protocol R_Third_NewYearThings_TVCellDelegate{

    func clickNewYearDIY(sectionNum: Int, num: Int)
    func clickNewYearDIYBigTitlt(num: Int)
    func clickNewYearDIYImg(section: Int, num: Int)
}

class R_Third_NewYearThings_TVCell: UITableViewCell {
    var delegate : R_Third_NewYearThings_TVCellDelegate!

    @IBOutlet weak var bigTitleBtn: UIButton!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var titleSmallLabel: UILabel!
    var num : Int!
    
    @IBAction func titleMoreClick(sender: AnyObject) {
        self.delegate.clickNewYearDIYBigTitlt(num)

    }

    @IBOutlet weak var descLabel: UILabel!
    @IBOutlet weak var leftBigImg: UIImageView!
    @IBOutlet weak var midUpImg: UIImageView!
    @IBAction func midUpMovieClick(sender: AnyObject) {
        self.delegate.clickNewYearDIY(num, num: 7)

    }
    @IBOutlet weak var midDownImg: UIImageView!
    @IBAction func midDownMovieClick(sender: AnyObject) {

        self.delegate.clickNewYearDIY(num,num:9)

    }
    @IBOutlet weak var rightUpImg: UIImageView!
    @IBAction func rightUpMovieClick(sender: AnyObject) {
        self.delegate.clickNewYearDIY(num, num:11)
    }
    @IBOutlet weak var rightDownImg: UIImageView!
    @IBAction func rightDownMovieClick(sender: AnyObject) {
        self.delegate.clickNewYearDIY(num, num:13)
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        let leftTap = UITapGestureRecognizer(target: self, action: "leftTap")
        leftBigImg.addGestureRecognizer(leftTap)

        let rightTap = UITapGestureRecognizer(target: self, action: "rightTap")
        midUpImg.addGestureRecognizer(rightTap)

        let midTap = UITapGestureRecognizer(target: self, action: "midTap")
        midDownImg.addGestureRecognizer(midTap)

        let leftHeadTap = UITapGestureRecognizer(target: self, action: "leftHeadTap")
        rightUpImg.addGestureRecognizer(leftHeadTap)

        let rightHeadTap = UITapGestureRecognizer(target: self, action: "rightHeadTap")
        rightDownImg.addGestureRecognizer(rightHeadTap)
    }

    func leftTap(){
    self.delegate.clickNewYearDIYBigTitlt(num)
    }

    func rightTap(){
        self.delegate.clickNewYearDIYImg(num, num: 4)
    }

    func midTap(){
        self.delegate.clickNewYearDIYImg(num, num: 6)

    }

    func leftHeadTap(){
        self.delegate.clickNewYearDIYImg(num, num: 8)
    }

    func rightHeadTap(){
        self.delegate.clickNewYearDIYImg(num, num: 10)
    }


    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
